<?php
	if (!empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password):	?>
		<p>请先输入密码</p>
<?php
		return;
	endif; ?>

<?php if ($comments): ?>
		<h3><?php comments_number('没人理我', '有1条留言', '有%条留言');?></h3>
		<ol class="commentlist">
	<?php foreach ($comments as $comment): ?>
			<li id="comment-<?php comment_ID() ?>">
		<?php echo get_avatar( $comment->comment_author_email, 48 ); ?>
			<p><cite><?php comment_author_link() ?></cite></p>
			<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></small>
		<?php comment_text() ?>
			</li>
	<?php endforeach; ?>
		</ol>
<?php else:
	if ('open' == $post->comment_status): ?>
	<?php else:?>
	<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status): ?>
	<?php if ( get_option('comment_registration') && !$user_ID ): ?>
		<p>必须先<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">登录</a>方可留言</p>
<?php else: ?>
		<h3 id="respond">请随便说两句</h3>
		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
	<?php if ($user_ID): ?>
			<p>您应该是<a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>吧，<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">不是吗？</a></p>
	<?php else: ?>
			<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /><label for="author">大名<label></p>
			<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2"/>
				<label for="email">信箱（以后不会公开显示）</label></p>
			<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /><label for="url">Blog地址<label></p>
	<?php endif; ?>
			<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
			<p><input name="submit" type="submit" id="submit" tabindex="5" value="提交留言" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
	<?php do_action('comment_form', $post->ID); ?>
		</form>
	<?php endif;
endif; ?>
